php forum
php mysql forum
php mysql smarty
 
Topic Options
#314979 - 07/26/07 08:33 PM [7.2.2] - Custom Title vs Title display
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
Simple modification that checks if a user has a Custom Title defined. If they do, then the Custom Title replaces the post based Title. (thanks to the pishmeister, who no one knows yet for this)

If they don't have a Custom Title, then the post based Title will be displayed.

Also does a small tweak to not include extra <br /> when the Rating system is turned off or the user doesn't have a rating. Right now it slams in a <br /> regardless. This saves some vertical space.

Ok.. here goes.

Open: /templates/default/post_side.tpl

Find:
Code:
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
<br />
{/if}
{$postrow[post].Title}
<br />
{$postrow[post].Rating}
<br />

Replace with:
Code:
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
{else}
{$postrow[post].Title}
{/if}
<br />
{if $postrow[post].Rating}
{$postrow[post].Rating}
<br />
{/if}

done!

Open: /templates/default/post_top.tpl

Find:
Code:
<span class="small">
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
<br />
{/if}
{$postrow[post].Title}
</span>

Replace with:
Code:
<span class="small">
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
{else}
{$postrow[post].Title}
{/if}
</span>

Done!

Open: /templates/default/post_comments.tpl

Find:
Code:
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
<br />
{/if}
{$postrow[post].Title}
<br />
{$postrow[post].Rating}
<br />

Replace with:
Code:
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
{else}
{$postrow[post].Title}
{/if}
<br />
{if $postrow[post].Rating}
{$postrow[post].Rating}
<br />
{/if}

Done!

Upload your files!

Enjoy wink
_________________________

Top
#314985 - 07/27/07 12:09 AM Re: [7.2] - Custom Title vs Title display [Re: sirdude]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
if you want to go further and also color the title or custom title according to the username's color, you can do the following.

open: /scripts/showflat.inc.php

find:
Php Code:
	 $postrow[$i]['Title']	= $Title;
		$postrow[$i]['CustomTitle'] = $CustomTitle; 

add above:
Php Code:
	 // SD - Mod (color, based upon user color or admin/mod color
		if ($Color) {
			$Title = "<span style=\"color:$Color;\">$Title</span>";
			if ($CustomTitle) {
				$CustomTitle = "<span style=\"color:$Color;\">$CustomTitle</span>";
			}
		}

		if (($PostStatus == "Administrator") && (!$Color)) {
			$Title = "<span class=\"adminname\">$Title</span>";
			if ($CustomTitle) {
				$CustomTitle = "<span class=\"adminname\">$CustomTitle</span>";
			}
		}
		elseif (($PostStatus == "Moderator") && (!$Color)) {
			$Title = "<span class=\"modname\">$Title</span>";
			if ($CustomTitle) {
				$CustomTitle = "<span class=\"modname\">$CustomTitle</span>";
			}
		} 


Done!

Upload this puppy

Enjoy wink
_________________________

Top
#315389 - 08/24/07 01:56 AM Re: [7.2] - Custom Title vs Title display [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: sirdude
Enjoy wink


Enjoyed! cool
_________________________

Top
#315390 - 08/24/07 03:17 AM Re: [7.2] - Custom Title vs Title display [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Pfff, just moved all custom titles we had in our post title fields that were imported over from 6.5.x. Removed the hacks that allowed me to edit the post title instead of the custom title.
_________________________

Top
#315399 - 08/24/07 10:40 AM Re: [7.2] - Custom Title vs Title display [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
if 'Pfff' a good thing ? smile

i hope laugh
_________________________

Top
#315400 - 08/24/07 10:57 AM Re: [7.2] - Custom Title vs Title display [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: sirdude
if 'Pfff' a good thing ? smile


Pfff is the best smile That's from being tired from lots of work smile

But it saves in the long run having everything cleaned up again smile
_________________________

Top
#315403 - 08/24/07 02:23 PM Re: [7.2] - Custom Title vs Title display [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: blaaskaak
Enjoyed! cool


Enjoy it even more?

/scripts/online.inc.php

find:

Code:
		if ($CustomTitle) {
			$Title = "$CustomTitle<br />$Title";
		}


replace with:

Code:
		if ($CustomTitle) {
			$Title = $CustomTitle;
		}


/scripts/showprofile.inc.php

find:

Code:
	$smarty_data = array(
		"profileuser" => $profileuser,
		"Fakeemail" => $Fakeemail,
		"Picture" => $Picture,
		"width" => $width,
		"height" => $height,
		"User" => $User,
		"Title" => "$Title<br />&nbsp; $CustomTitle",


replace with:

Code:
	if ($CustomTitle) { $title=$CustomTitle; };
	$smarty_data = array(
		"profileuser" => $profileuser,
		"Fakeemail" => $Fakeemail,
		"Picture" => $Picture,
		"width" => $width,
		"height" => $height,
		"User" => $User,
		"Title" => $Title,


this will take of who's online and the userprofile screen!


Edited by blaaskaak (08/24/07 02:41 PM)
_________________________

Top
#315404 - 08/24/07 03:58 PM Re: [7.2] - Custom Title vs Title display [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
hehe and just to be totally complete.. viewmessage too ! laugh

i just didn't post them here..

blaaskaak.. ty!! smile

if you haven't posted the viewmessage (both script + template) thingie, i will do it later on today..
_________________________

Top
#315410 - 08/25/07 01:13 AM Re: [7.2] - Custom Title vs Title display [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: sirdude
hehe and just to be totally complete.. viewmessage too ! laugh


That one already looks ok. It uses the post_side and post_top templates if I'm correct.

Quote:
if you haven't posted the viewmessage (both script + template) thingie, i will do it later on today..


Don't worry, just concentrate on the naked chat suggestions I made smile
_________________________

Top
#315415 - 08/25/07 11:29 AM Re: [7.2] - Custom Title vs Title display [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
hrm. you have a point.. i was stuck back in 7.0.2 days with the templates. good catch..

ok.. i will be working on the unclothed messaging system this weekend. i'll see what i get added.
_________________________

Top
#315506 - 08/31/07 11:37 PM Re: [7.2] - Custom Title vs Title display [Re: sirdude]
ntdoc Offline
Newbie

Registered: 12/14/06
Posts: 16
Please see this post. I would like it to operate a bit differently myself.

http://www.ubbcentral.com/forums/ubbthreads.php/ubb/showflat/Number/195926

Top
#315507 - 09/01/07 01:42 AM Re: [7.2] - Custom Title vs Title display [Re: ntdoc]
ntdoc Offline
Newbie

Registered: 12/14/06
Posts: 16
Okay just want to say Thanks guys.

This mod by SirDude and blaaskaak works just fine on my site. I'm happy with it.

The issue appears to be that if you want BOTH Default and Custom titles to show then this mod won't work for you. For me I just want the one Default to show and it works great.

Currently the code in 7.2.2 is less than adequate for me and I had to keep manually updating the database each day to fix it.

Doing these fixes as shown by SirDude and blaaskaak will restore it back to they way it used to work in 6.x (at least as I recall it working)

Thanks again guys rockon

Top
#316279 - 11/09/07 01:09 AM [7.2.x] If Custom Title
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Modification Name: If Custom Title [beta]

Author(s): Allen Ayres

Description: If you have a custom title, this displays it instead of the member title.

Requirements: UBB.Threads 7.2.x (may work with other 7 series)

Demo: None yet

Notes: I may have missed some spots, but I think this covers most smile


Attachments
IfCustomTitle.txt (46 downloads)
Description: Instructions


_________________________
- Allen wavey
- What Drives You?

Top
#316282 - 11/09/07 02:38 AM Re: [7.2.x] If Custom Title [Re: AllenAyres]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands


Edited by blaaskaak (11/09/07 02:39 AM)
_________________________

Top
#316283 - 11/09/07 02:39 AM Re: [7.2.x] If Custom Title [Re: AllenAyres]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Looks good allen, but I could have sworn someone else posted this before...

BTW, this will likely throw out "undefined index" errors, you should read up on isset
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#316285 - 11/09/07 03:02 AM Re: [7.2.x] If Custom Title [Re: Gizmo]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
no, it won't wink

_________________________

Top
#316286 - 11/09/07 04:30 AM Re: [7.2.x] If Custom Title [Re: sirdude]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
wink mmmhmmm wink

_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#316290 - 11/09/07 09:42 AM Re: [7.2.x] If Custom Title [Re: Gizmo]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Originally Posted By: Gizmo
Looks good allen, but I could have sworn someone else posted this before...

BTW, this will likely throw out "undefined index" errors, you should read up on isset


?

I'm calling variables already in place, shouldn't be any errors tipsy
_________________________
- Allen wavey
- What Drives You?

Top
#316291 - 11/09/07 09:48 AM Re: [7.2.x] If Custom Title [Re: AllenAyres]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
btw, I had no idea it was done already, I coulda used this a month ago more than once. tipsy
_________________________
- Allen wavey
- What Drives You?

Top
#316295 - 11/09/07 02:24 PM Re: [7.2.x] If Custom Title [Re: AllenAyres]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Originally Posted By: AllenAyres
Modification Name: If Custom Title [beta]

Author(s): Allen Ayres

Description: If you have a custom title, this displays it instead of the member title.

Requirements: UBB.Threads 7.2.x (may work with other 7 series)

Demo: None yet

Notes: I may have missed some spots, but I think this covers most smile


Merged here... you might consider collecting the pieces in the topic and combining for a text file instruction, would help those trying to install it once wink
_________________________
- Allen wavey
- What Drives You?

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks